Composable and Reusable Business Rules Using AspectJ*
نویسندگان
چکیده
public class BRPriceDiscount{ private Float percentage; abstract public boolean condition(); public Float action(Float price){...} public Float apply(Float price){ if (condition()){ return action(price); else{return price}; } } } Suppose we consider two concrete price personalization business rules: BR1 if today is Christmas then a customer gets a 5% discount and BR2 if the customer has bought more than 10 products then he or she gets a 10% discount on the current purchase. The implementation in JavaTM of these rules, BRChristmasDiscount and BRPurchasedItemsDiscount respectively is shown below. They define concrete implementations for the inherited method condition(). public class BRChristmasDiscount extends BRPriceDiscount{ private boolean isChristmas(){...} public boolean condition(){ return isChristmas(); } } public class BRPurchasedItemsDiscount extends BRPriceDiscount{ Customer customer; public void setCustomer(Customer c){ customer = c; } public boolean condition(){ // returns if customer purchased more than 10 products } } As part of the connectivity layer we need to define the following aspects: An aspect EPricePersonalisation identifies the event in the core application that defines the application time of both business rules
منابع مشابه
Aspect-Oriented Programming for Connecting Business Rules
In object-oriented business support applications, separating business rules from core application functionality is crucial. Essential to business rules are their connectors to the core application, which existing approaches fail to support explicitly. Our paper presents requirements for encapsulating business rule connectors and shows that Aspect-Oriented Programming is necessary to fulfil them...
متن کاملLinking business rules to object-oriented software using JAsCo
Object-oriented software applications that support a particular business or domain consist of substantial core application functionality and business rules. Since business rules tend to evolve frequently, it is important to separate them from the core application. However, current approaches that support business rules at the implementation level only separate the business rules themselves and ...
متن کاملJAsCo for Linking Business Rules to Object-Oriented Software
Object-oriented software applications that support a particular business or domain consist of substantial core application functionality and business rules. Since business rules tend to evolve frequently, it is important to separate them from the core application. However, current approaches that support business rules at the implementation level only separate the business rules themselves and ...
متن کاملFoundations of Aspect Oriented Business Process Management
Reducing complexity in Information Systems is a main concern in both research and industry. One strategy for reducing complexity is separation of concerns. This strategy advocates separating various concerns, like security and privacy, from the main concern. It results in less complex, easily maintainable, and more reusable Information Systems. Separation of concerns is addressed through the As...
متن کاملA Sequence of Patterns for Reusable Aspect Libraries with Easy Configuration
Using well-known AspectJ idioms has been shown to increase the reusability of aspect libraries. Availability of such reusable libraries is an important motivating factor to drive the further adoption of AspectJ in industry and aspect-oriented-programming in general. Existing work, however, mostly presents the existing AspectJ idioms as relatively independent solutions. As experience grows in us...
متن کامل